package com.codinghero.zqlb.spider.dao;

import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.codinghero.sql.DBOper;
import com.codinghero.sql.MySQLOper;
import com.codinghero.zqlb.Constant;

public class BaseDao {
	
	protected DBOper dbOper;
	
	public BaseDao() {
		dbOper = new MySQLOper(Constant.JDBC_URL, Constant.USER_ID,
				Constant.PASSWORD);
	}
	
	public void connect() throws SQLException {
		dbOper.connect();
	}
	
	public void close() {
		dbOper.close();
	}
	
	public void startTransaction() throws SQLException {
		dbOper.startTransaction();
	}
	
	public void commit() throws SQLException {
		dbOper.commit();
	}
	
	public void rollback() {
		dbOper.rollback();
	}
	
	public void addBatch(String sql) throws SQLException {
		dbOper.addBatch(sql);
	}
	
	public void executeBatch() throws SQLException {
		dbOper.executeBatch();
	}
}
